package com.example.administrator.maizuofilm.card.activity;

import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

/**
 * Created by Administrator on 2016/7/13.
 */
public class CardPresenter implements CardContract.CardPresenter<CardContract.CardModel,CardContract.CardView>{
    private CardContract.CardModel cardModel;
    private CardContract.CardView cardView;

    public CardPresenter(CardContract.CardModel cardModel, CardContract.CardView cardView) {
        this.cardModel = cardModel;
        this.cardView = cardView;
    }

    @Override
    public void init() {
        cardModel.init();
    }
    @Subscribe(threadMode = ThreadMode.MAIN)
    public void sub(String json) {
        if (json == null) {
            cardView.onInitFail("失败");
        } else {
            cardView.onInitSuccess(json);
        }
    }
}
